iT邦幫忙

2022 iThome 鐵人賽

DAY 13
0
Security

HONEYPOT×TRICK 100%不純保證系列 第 13

Honeypot #8 再慘敗的 honeyd 1.6d 安裝過程

  • 分享至 

  • xImage
  •  

讓我們懷念它


https://ithelp.ithome.com.tw/upload/images/20220928/20103688yj0ycVc8cF.png

1.6d 是第三方開發的版本,套件 libevent 跟上了 2 版的更新,也比較能在新的作業系統執行...個頭啦! 安裝在 T-Pot 的Debian 11 還是失敗了,讓我們繼續看下去honeyd 能再水多少篇文章....

後記: 作業系統降版為 Ubuntu 18 後已經可以安裝 Honeyd 1.6 版了! 將記錄在下一篇。

變體 honeyd 1.6 安裝

參考 1.6d版的說明,前置安裝一次來

sudo apt-get install libevent-dev libdumbnet-dev libpcap-dev libpcre3-dev libedit-dev bison flex libtool automake

多了一些軟體,安裝上沒有什麼問題。
接著是從 github 下載回來 (有安裝 git 者可直接 clone)

wget https://github.com/DataSoft/Honeyd/archive/refs/heads/master.zip

解壓縮

unzip master.zip

開始按照說明執行

cd Honeyd-master/

./autogen.sh
aclocal: warning: autoconf input should be named 'configure.ac', not 'configure.in'
libtoolize: putting auxiliary files in '.'.
libtoolize: linking file './ltmain.sh'
libtoolize: Consider adding 'AC_CONFIG_MACRO_DIRS([m4])' to configure.in,
libtoolize: and rerunning libtoolize and aclocal.
libtoolize: Consider adding '-I m4' to ACLOCAL_AMFLAGS in Makefile.am.
automake: warning: autoconf input should be named 'configure.ac', not 'configure.in'
configure.in:8: warning: AM_INIT_AUTOMAKE: two- and three-arguments forms are deprecated.  For more info, see:
configure.in:8: https://www.gnu.org/software/automake/manual/automake.html#Modernize-AM_005fINIT_005fAUTOMAKE-invocation
configure.in:12: installing './compile'
configure.in:5: installing './config.guess'
configure.in:5: installing './config.sub'
Makefile.am:135: warning: 'INCLUDES' is the old name for 'AM_CPPFLAGS' (or '*_CPPFLAGS')
automake: warning: autoconf input should be named 'configure.ac', not 'configure.in'
Makefile.am:151: warning: source file 'subsystems/proxy.c' is in a subdirectory,
Makefile.am:151: but option 'subdir-objects' is disabled
automake: warning: possible forward-incompatibility.
automake: At least a source file is in a subdirectory, but the 'subdir-objects'
automake: automake option hasn't been enabled.  For now, the corresponding output
automake: object file(s) will be placed in the top-level directory.  However,
automake: this behaviour will change in future Automake versions: they will
automake: unconditionally cause object files to be placed in the same subdirectory
automake: of the corresponding sources.
automake: You are advised to start using 'subdir-objects' option throughout your
automake: project, to avoid future incompatibilities.
Makefile.am:151: warning: source file 'subsystems/proxy_main.c' is in a subdirectory,
Makefile.am:151: but option 'subdir-objects' is disabled
Makefile.am:151: warning: source file 'subsystems/smtp.c' is in a subdirectory,
Makefile.am:151: but option 'subdir-objects' is disabled
Makefile.am:142: warning: source file 'subsystems/smtp.c' is in a subdirectory,
Makefile.am:142: but option 'subdir-objects' is disabled
Makefile.am:142: warning: source file 'subsystems/smtp_main.c' is in a subdirectory,
Makefile.am:142: but option 'subdir-objects' is disabled
configure.in: installing './ylwrap'

./configure

至此出現

configure: error: "libevent is too old - you need to install a newer version.  Check http://www.monkey.org/~provos/libevent/" 

嘗試照 https://superuser.com/questions/1159705/configure-error-libevent-is-too-old-you-need-to-install-a-newer-version ,將指令修改為 ./configure --with-libevent

./configure --with-libevent
make

還是會出現一堆 undefined reference 錯誤

usr/bin/ld: /home/tsec/Honeyd-master/untagging.c:76: undefined reference to `evbuffer_free'
/usr/bin/ld: /home/tsec/Honeyd-master/untagging.c:80: undefined reference to `evbuffer_free'
collect2: error: ld returned 1 exit status
make[2]: *** [Makefile:858: honeyd] Error 1
make[2]: Leaving directory '/home/tsec/Honeyd-master'
make[1]: *** [Makefile:1246: all-recursive] Error 1
make[1]: Leaving directory '/home/tsec/Honeyd-master'
make: *** [Makefile:702: all] Error 2

換成另一個指令則是找不到 libevent

./configure --with-libevent=/usr

configure: error: event.h or libevent.a not found in /usr

github 上有一樣的問題但沒人回答 ,只好試著再手動安裝 libevent 套件。

除錯 libevent

降級 libevet 2.1.12 > 2.0.21

試著降 libevent 版本到當年的版本,參考 https://www.linuxfromscratch.org/blfs/view/7.6/basicnet/libevent.html

wget https://github.com/downloads/libevent/libevent/libevent-2.0.21-stable.tar.gz
 tar -xvf libevent-2.0.21-stable.tar.gz
 cd libevent-2.0.21-stable
 
 ./configure --prefix=/usr --disable-static 
make

執行結果失敗,顯示openssl 的問題

/usr/include/x86_64-linux-gnu/openssl/opensslconf.h:20:3: error: #error OPENSSL_ALGORITHM_DEFINES no longer supported

可能是原本就有安裝 openssl 1.1 的問題,參考 https://blog.csdn.net/qq_38781075/article/details/113774738 ,移掉 1.1 的檔案

sudo mv /usr/include/x86_64-linux-gnu/openssl/opensslconf.h /usr/include/x86_64-linux-gnu/openssl/opensslconf.h.bak

結果還是提示 openssl 的問題,那就再試著降級 openssl 看看!

降級 OpenSSL 1.1.1n > 1.0.1i

參考 https://www.linuxfromscratch.org/blfs/view/7.6/postlfs/openssl.html 安裝

wget http://www.openssl.org/source/openssl-1.0.1i.tar.gz
tar -xvf openssl-1.0.1i.tar.gz
cd openssl-1.0.1i

先更新 patch

原官方連結
http://www.linuxfromscratch.org/patches/blfs/7.6/openssl-1.0.1i-fix_parallel_build-1.patch 已失效,改用以下連結

wget https://www.linuxfromscratch.org/patches/downloads/openssl/openssl-1.0.1i-fix_parallel_build-1.patch
patch -Np1 -i ./openssl-1.0.1i-fix_parallel_build-1.patch
./config --prefix=/usr         \
         --openssldir=/etc/ssl \
         --libdir=lib          \
         shared                \
         zlib-dynamic
make
make test 

至 make test 失敗,提示

signed content DER format, RSA key: verify error
make[1]: *** [Makefile:315: test_cms] Error 1
make[1]: Leaving directory '/home/tsec/openssl-1.0.1/test'
make: *** [Makefile:456: tests] Error 2

至此,再度放棄...想要偷懶整合在 T-Pot 上看來是無望了,下一篇將嘗試將作業系統改為 Ubuntu 並往 18, 16 ,14 下推至成功為止!


上一篇
Honeypot #7 慘敗的 honeyd 1.5c 安裝過程
下一篇
Honeypot #9 [Honeyd] 環境安裝 - 在 Ubuntu 18.04 安裝 Honeyd1.6d
系列文
HONEYPOT×TRICK 100%不純保證33
圖片
  直播研討會
圖片
{{ item.channelVendor }} {{ item.webinarstarted }} |
{{ formatDate(item.duration) }}
直播中

尚未有邦友留言

立即登入留言